subroutine run(ie, t1, t2, r1, r2,fij, fab, fia, & 
          fae, fmi, fme, iijkl, wmnij, iijka, &
          iabij, iiabj, wmbej, iabci, iabcd, icore, &
          maxcore, escf, eccsd, eccsdt) 
use mod_iop
use mod_size
use mod_orbit
use mod_ioff
implicit none
integer prec2, isd2, igpu2, totgpu2
common/precsoc/prec2, isd2, igpu2, totgpu2
!
integer, intent(inout) :: maxcore
real*8, intent(inout) :: escf, eccsd, eccsdt
real*4, intent(in) :: ie(*), fij(*), fab(*), fia(*)
real*4, intent(in) :: fae(*), fmi(*), fme(*)
real*4, intent(in) :: t1(*), t2(*), r1(*), r2(*)
real*4, intent(in) :: iijka(*), iabij(*), iijkl(*)
real*4, intent(in) :: wmnij(*), wmbej(*)
real*4, intent(in) :: iiabj(*), iabci(*), iabcd(*), icore(*)
real*4, allocatable,device :: ig(:)
!
integer nsize 
integer i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10 
integer i11, i12, i13, i14, i15, i16, i17, i18, i19
integer, external :: irpdso, idsymsoc
!
!prec2=prec; isd2=isd; igpu2=igpu; totgpu2=totgpu
!write(6,*)'totgpu', totgpu, totgpu2
if(prec==8) then 
call load(ie, fij, fab, fia, & 
          iijkl, iijka, iabij, iiabj, iabci, iabcd, &
          icore, escf)
elseif(prec==4) then 
call load_s(ie, fij, fab, fia, & 
          iijkl, iijka, iabij, iiabj, iabci, iabcd, &
          icore, escf)
endif
if(ldebug) then 
   write(6,*)'finished load'
endif
!
  call srccsd(ie, fij, fab, fia,  & 
            iijkl, iijka, iabij, iiabj, iabci, iabcd, &
            t1, t2, r1, r2, fae, fmi, fme, wmnij, wmbej, icore,&
            maxcore, escf, eccsd)
return
end 
